<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>MyBatis vs MyBatis-Plus 深度对比</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
            min-height: 100vh;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
        }
        .feature-icon {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .section-title::before {
            content: '';
            position: absolute;
            left: 0;
            bottom: -10px;
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
            border-radius: 2px;
        }
        .drop-cap {
            float: left;
            font-size: 4rem;
            line-height: 1;
            font-weight: 700;
            margin-right: 0.5rem;
            margin-top: -0.2rem;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
        .mermaid {
            display: flex;
            justify-content: center;
            margin: 2rem 0;
        }
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(30px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        .animate-fadeInUp {
            animation: fadeInUp 0.8s ease-out;
        }
        .gradient-text {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
    </style>
</head>
<body>
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-6">
        <div class="max-w-6xl mx-auto text-center animate-fadeInUp">
            <h1 class="text-5xl md:text-6xl font-bold mb-6">
                MyBatis <span class="text-yellow-300">vs</span> MyBatis-Plus
            </h1>
            <p class="text-xl md:text-2xl mb-8 opacity-90">深入解析两大持久层框架的差异与选择</p>
            <div class="flex justify-center space-x-8 text-lg">
                <div class="flex items-center">
                    <i class="fas fa-database mr-2"></i>
                    <span>ORM框架对比</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-code mr-2"></i>
                    <span>开发效率提升</span>
                </div>
                <div class="flex items-center">
                    <i class="fas fa-rocket mr-2"></i>
                    <span>最佳实践指南</span>
                </div>
            </div>
        </div>
    </section>

    <!-- Introduction Section -->
    <section class="py-16 px-6 bg-white">
        <div class="max-w-4xl mx-auto">
            <div class="prose prose-lg max-w-none">
                <p class="text-lg leading-relaxed text-gray-700">
                    <span class="drop-cap">M</span>yBatis 是一个优秀的 ORM 框架，底层是对 JDBC 的封装，为 Java 开发者提供了灵活的数据库操作方式。而 MyBatis-Plus（简称 MP）则是对 MyBatis 的增强工具，在保留 MyBatis 所有特性的基础上，提供了更多便捷的功能。
                </p>
                <div class="mt-8 p-6 bg-purple-50 rounded-lg border-l-4 border-purple-500">
                    <h3 class="text-xl font-bold text-purple-800 mb-3">
                        <i class="fas fa-star mr-2"></i>MyBatis-Plus 核心特性
                    </h3>
                    <div class="grid grid-cols-2 md:grid-cols-3 gap-4 text-gray-700">
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-purple-600 mr-2"></i>
                            <span>CRUD 接口</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-purple-600 mr-2"></i>
                            <span>分页插件</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-purple-600 mr-2"></i>
                            <span>条件查询</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-purple-600 mr-2"></i>
                            <span>主键策略</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-purple-600 mr-2"></i>
                            <span>分库分表</span>
                        </div>
                        <div class="flex items-center">
                            <i class="fas fa-check-circle text-purple-600 mr-2"></i>
                            <span>乐观锁机制</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Visualization -->
    <section class="py-16 px-6 bg-gray-50">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12 gradient-text">框架对比可视化</h2>
            <div class="bg-white p-8 rounded-xl shadow-lg">
                <div class="mermaid">
                    graph TD
                        A[持久层框架选择] --> B[MyBatis]
                        A --> C[MyBatis-Plus]
                        
                        B --> D[手动编写SQL]
                        B --> E[XML配置文件]
                        B --> F[灵活性高]
                        
                        C --> G[自动生成SQL]
                        C --> H[注解驱动]
                        C --> I[开发效率高]
                        
                        D --> J[完全控制SQL]
                        E --> K[复杂查询支持]
                        F --> L[适合复杂业务]
                        
                        G --> M[CRUD自动化]
                        H --> N[减少配置]
                        I --> O[快速开发]
                        
                        style A fill:#667eea,stroke:#fff,stroke-width:2px,color:#fff
                        style B fill:#fbbf24,stroke:#fff,stroke-width:2px,color:#fff
                        style C fill:#10b981,stroke:#fff,stroke-width:2px,color:#fff
                </div>
            </div>
        </div>
    </section>

    <!-- Feature Comparison -->
    <section class="py-16 px-6 bg-white">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12 relative">
                <span class="section-title relative inline-block">核心差异对比</span>
            </h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <!-- 功能差异 -->
                <div class="card-hover bg-gradient-to-br from-purple-50 to-pink-50 p-8 rounded-xl">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-cogs text-3xl feature-icon mr-4"></i>
                        <h3 class="text-2xl font-bold">功能差异</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-purple-700 mb-2">MyBatis</h4>
                            <p class="text-gray-600">轻量级持久层框架，提供基本的SQL映射功能，需要手动编写SQL语句和XML配置文件。</p>
                        </div>
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-pink-700 mb-2">MyBatis-Plus</h4>
                            <p class="text-gray-600">MyBatis的增强工具，提供自动生成SQL、条件构造器、分页、性能分析等高级功能。</p>
                        </div>
                    </div>
                </div>

                <!-- SQL语句生成 -->
                <div class="card-hover bg-gradient-to-br from-blue-50 to-cyan-50 p-8 rounded-xl">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-code text-3xl feature-icon mr-4"></i>
                        <h3 class="text-2xl font-bold">SQL语句生成</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-blue-700 mb-2">MyBatis</h4>
                            <p class="text-gray-600">需要手动编写SQL语句，开发者需要自己管理SQL语句的编写和优化。</p>
                        </div>
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-cyan-700 mb-2">MyBatis-Plus</h4>
                            <p class="text-gray-600">根据实体类的注解自动生成CRUD的SQL语句，大幅简化开发工作。</p>
                        </div>
                    </div>
                </div>

                <!-- 分页功能 -->
                <div class="card-hover bg-gradient-to-br from-green-50 to-emerald-50 p-8 rounded-xl">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-file-alt text-3xl feature-icon mr-4"></i>
                        <h3 class="text-2xl font-bold">分页功能</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-green-700 mb-2">MyBatis</h4>
                            <p class="text-gray-600">分页功能需要开发者手动编写分页SQL语句，并处理分页逻辑。</p>
                        </div>
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-emerald-700 mb-2">MyBatis-Plus</h4>
                            <p class="text-gray-600">提供便捷的分页查询方法，只需调用相应方法并传入分页参数即可。</p>
                        </div>
                    </div>
                </div>

                <!-- 代码生成器 -->
                <div class="card-hover bg-gradient-to-br from-yellow-50 to-orange-50 p-8 rounded-xl">
                    <div class="flex items-center mb-4">
                        <i class="fas fa-magic text-3xl feature-icon mr-4"></i>
                        <h3 class="text-2xl font-bold">代码生成器</h3>
                    </div>
                    <div class="space-y-4">
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-yellow-700 mb-2">MyBatis</h4>
                            <p class="text-gray-600">没有自带的代码生成器，需要借助第三方工具生成实体类和Mapper接口。</p>
                        </div>
                        <div class="bg-white p-4 rounded-lg">
                            <h4 class="font-semibold text-orange-700 mb-2">MyBatis-Plus</h4>
                            <p class="text-gray-600">提供自带的代码生成器，可根据数据库表自动生成完整的代码结构。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Usage Comparison -->
    <section class="py-16 px-6 bg-gray-50">
        <div class="max-w-6xl mx-auto">
            <h2 class="text-3xl font-bold text-center mb-12 relative">
                <span class="section-title relative inline-block">使用方式对比</span>
            </h2>
            
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-8 rounded-xl shadow-lg">
                    <h3 class="text-2xl font-bold mb-6 text-purple-700">
                        <i class="fas fa-database mr-2"></i>MyBatis
                    </h3>
                    <ul class="space-y-3">
                        <li class="flex items-start